<template>
  <div id="link">
    <div class="leftLink">
      <span @click="controllerLogin">我是管理员</span>
    </div>
    <div class="rightLink">
      <span @click="studentLogin">我是学生</span>
    </div>
  </div>
</template>

<script>
export default {
  name: "linkApp",
  data() {
    return {};
  },
  methods: {
    controllerLogin() {
      if (!sessionStorage.getItem("controllerInfo")) {
        this.$router.push("/controllerLogin");
      } else {
        this.$router.push("/controller");
      }
    },
    studentLogin() {
      if (!sessionStorage.getItem("studentInfo")) {
        this.$router.push("/studentLogin");
      } else {
        this.$router.push("/student");
      }
    },
  },
};
</script>

<style scoped>
#link {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.leftLink {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: green;
}
.rightLink {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(233, 83, 14);
}
.leftLink a,
.rightLink a {
  color: #fff;
}
span {
  color: #fff;
  border-bottom: 2px solid #fff;
}
span:hover {
  cursor: pointer;
}
</style>